-
Couldn't load subscription status.
- Fork 1.5k
Merge main #1755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge main #1755
Conversation
* Improve the styling of the view - use the re-usable InputField component - layout the images in a 2x2 grid - add rounded corners - add a progress overlay * Allow user to cancel the image generation process --------- Signed-off-by: Peter Friese <[email protected]>
Bumps [json](https://github.com/ruby/json) from 2.10.1 to 2.10.2. - [Release notes](https://github.com/ruby/json/releases) - [Changelog](https://github.com/ruby/json/blob/master/CHANGES.md) - [Commits](ruby/json@v2.10.1...v2.10.2) --- updated-dependencies: - dependency-name: json dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
[Infra] Update build-for-testing.sh
[Infra] Update test.sh
Auto-update dependencies.
* Update vertexai's README.md * Update vertexai's README to not mention the mock GoogleService-Info.plist Because there is not such file. Also, changes to them are ignored by git anyways (see [.gitignore](.gitignore#L5)).
* Copy vertexai directory to firebaseai * Rename directories, files, and scheme and build/run again * Run on firebase-ai branch * to import FirebaseAI * Update to googleAI and comment vertexAI configures * readme updates * firebaseai.yml * style * Apply suggestions from code review Co-authored-by: Andrew Heard <[email protected]> * Update package dependency to FirebaseAI * Fix scheme name * Fix SAMPLE env --------- Co-authored-by: Andrew Heard <[email protected]>
* feat: Add backend toggle for Google AI/Vertex AI in FirebaseAISample Adds a picker UI to the main `FirebaseAISample` screen allowing users to select between Google AI and Vertex AI backends. - Introduced an `AIBackend` enum to represent the choices. - Added a `@State` variable in `FirebaseAISampleApp` to manage the selection. - Added a `Picker` in `ContentView` bound to the state variable. - Passed the selected backend down to each sample view (`Summarize`, `PhotoReasoning`, `Chat`, `FunctionCalling`, `Imagen`). - Updated the ViewModels for each sample to accept the backend choice and initialize `FirebaseAI.firebaseAI(backend:)` accordingly. - Refactored the `AIBackend` enum to a common location. * feat: Add backend toggle for Google AI / Vertex AI Adds a Picker UI to the main ContentView allowing users to select between Google AI and Vertex AI as the backend for the Generative AI samples. - Introduced a `BackendOption` enum. - Added a Picker in `ContentView` bound to a state variable holding the selected backend. - Modified sample Screens (`SummarizeScreen`, `PhotoReasoningScreen`, `ConversationScreen`, `FunctionCallingScreen`, `ImagenScreen`) to accept the chosen `FirebaseAIBackend` in their initializers. - Updated corresponding ViewModels (`SummarizeViewModel`, `PhotoReasoningViewModel`, `ConversationViewModel`, `FunctionCallingViewModel`, `ImagenViewModel`) to receive the backend instance via their initializers and use it when initializing the Firebase AI service, removing the previously hardcoded `.googleAI()` backend. * refactor: Centralize FirebaseAI service initialization Refactors the codebase based on feedback to initialize the FirebaseAI service instance once in ContentView and pass it down the hierarchy, instead of passing the backend option and initializing the service in each ViewModel. - ContentView now manages a @State variable `firebaseService: FirebaseAI` which is updated when the backend Picker selection changes. - Sample Screens now receive the `firebaseService` instance in their initializers. - ViewModels now receive the `firebaseService` instance from their respective Screens and use it directly to obtain generative/Imagen models, removing the internal service initialization call. * Build fixes * Fix previews and cleanup jules verbosity * review and more cleanup * Cleanup explanatory Jules comments * One more extraneous comment * Update firebaseai/ChatSample/Screens/ConversationScreen.swift Co-authored-by: Andrew Heard <[email protected]> * Update firebaseai/ChatSample/Screens/ConversationScreen.swift Co-authored-by: Andrew Heard <[email protected]> * Update firebaseai/FunctionCallingSample/Screens/FunctionCallingScreen.swift Co-authored-by: Andrew Heard <[email protected]> --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: Andrew Heard <[email protected]>
[Infra] Upgrade to FirebaseUI v15
Auto-update dependencies.
Auto-update dependencies.
#1719) * change ImagenScreen UI from ZStack to ScrollView * change fix size of images to flexible * center the progressoverlay in firebase Imagen * remove unrelated comments in imagen
Auto-update dependencies.
Auto-update dependencies.
Add Data Connect quickstart link
Auto-update dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @ncooke3, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request performs a significant update and restructuring of the project's quickstart examples and underlying dependencies. It removes outdated quickstarts, introduces new ones for emerging Firebase features, and ensures compatibility with newer iOS versions and development tools.
Highlights
- Quickstart Restructuring: The AdMob and Dynamic Links quickstarts have been completely removed from the project, while new Firebase AI and Firebase Data Connect quickstarts have been introduced.
- Minimum Deployment Target Update: The minimum iOS deployment target across most quickstarts has been consistently raised from iOS 13.0/14.0 to iOS 15.0. Corresponding tvOS deployment targets were also updated to 15.0 where applicable.
- Dependency Version Bumps: Numerous third-party dependencies, including core RubyGems (e.g., activesupport, json) and various Firebase SDKs (e.g., Analytics, Authentication, Crashlytics, Functions, Storage, FirebaseUI), have been updated to their latest versions. This includes a change in Firebase Analytics subspec from
AdIdSupporttoDefaultand the addition ofGoogleAdsOnDeviceConversion. - Build System Enhancements: The build environment has been updated to use Xcode 16.4, and a new build flag (
ENABLE_DEBUG_DYLIB=NO) was added to prevent potential signing issues with preview dylibs.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request appears to merge changes from the main branch, including the removal of deprecated AdMob and Dynamic Links examples and the introduction of a comprehensive new Firebase AI example. The changes also involve updating deployment targets, dependencies, and build scripts across various projects. The new Firebase AI code is well-structured. My review includes a high-severity comment to prevent a potential crash in the function calling example by handling empty API responses more gracefully, and a couple of medium-severity suggestions to improve error feedback to the user in the Imagen example.
| guard let candidate = content.candidates.first else { | ||
| fatalError("No candidate.") | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of fatalError here can cause the app to crash if the model returns a response with no candidates, for example, due to safety settings. It's better to handle this case gracefully by setting an error state and displaying a message to the user.
guard let candidate = content.candidates.first else {
if let promptFeedback = content.promptFeedback {
self.error = GenerateContentError.promptBlocked(response: content)
} else {
self.error = NSError(domain: "com.google.firebase.quickstart", code: -1, userInfo: [NSLocalizedDescriptionKey: "No candidate in response."])
}
messages.removeLast()
return
}| if let filteredReason = response.filteredReason { | ||
| print("Image(s) Blocked: \(filteredReason)") | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason for images being filtered is only printed to the console. It would be a better user experience to display this information in the UI, for example, by setting the errorMessage property.
| if let filteredReason = response.filteredReason { | |
| print("Image(s) Blocked: \(filteredReason)") | |
| } | |
| if let filteredReason = response.filteredReason { | |
| errorMessage = "Image(s) Blocked: \(filteredReason)" | |
| print("Image(s) Blocked: \(filteredReason)") | |
| } |
| if !Task.isCancelled { | ||
| logger.error("Error generating images: \(error)") | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK if I merge main into mc/spm?